/**
 * 
 */
package vanhoc.android.mediakool.custom.adapter;

import java.util.ArrayList;
import java.util.List;

import vanhoc.android.medialcool.item.data.DashboardItemData;
import vanhoc.android.medialcool.item.layout.DashboardItemView;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

/**
 * @author Administrator
 *
 */
public class DashboardGridAdpater extends ArrayAdapter<DashboardItemData> {
	ArrayList<DashboardItemData> arrListItemView;
	
	Context mContext;
	
	public DashboardGridAdpater(Context context, int textViewResourceId,
			List<DashboardItemData> objects) {
		super(context, textViewResourceId, objects);
		// TODO Auto-generated constructor stub
		
		mContext = context;
		
		arrListItemView	=	(ArrayList<DashboardItemData>) objects;
	}
	
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		//return super.getView(position, convertView, parent);
		DashboardItemView itemView;
		itemView = new DashboardItemView(mContext);
		itemView.itemIcon.setImageResource(arrListItemView.get(position).getIconResourch());
		itemView.itemTitle.setText(arrListItemView.get(position).getTitle());
		
		return itemView;
	}

}
